package net.Reality.Android.Ant;
import java.util.Vector;
import android.R.integer;
import android.graphics.Picture;
import android.util.Log;

public class Object {

	int x;
	int y;
	int number;
	Vector<Edge> edge = new Vector<Edge>();
	Vector<Stone> stone = new Vector<Stone>();
	Vector<Integer> ant = new Vector<Integer>();
	
	
	int AntNum;
	
	public class  Edge{
        public int x;
        public int y;
        
        public Edge(int x, int y)
        {
        	this.x = x;
        	this.y = y;
        }
	}

	public class  Stone{
        public int x;
        public int y;
        public int Picture;       
        
        public Stone(int x, int y)
        {
        	this.x = x;
        	this.y = y;
        	this.Picture=4;
        }        
        public Boolean deduct()
        {
        	Picture--; 
        	if(Picture<0)
        		return true;
        	else
        		return false;
        }       
	}
	
	
	public Object(DataBase db,String name)
	{
		Log.e("1bbbbb     - - - - - - -    ",name);

		
		//String name="tunnel_vertical_6";		
		String []s_x= db.myData.get(name+"_x").split(",");
		String []s_y=db.myData.get(name+"_y").split(",");
		number=Integer.parseInt(db.myData.get(name+"_stone"));
		String []s_stone_x=db.myData.get(name+"_stone_x").split(",");
		String []s_stone_y=db.myData.get(name+"_stone_y").split(",");
		
		for(int i=0;i<s_x.length;i++)
		{			
			//Log.e("1bbbbb     - - - - - - -    ",s_x[i]+"   "+ s_y[i] );
			edge.add(new Edge(Integer.parseInt(s_x[i]) ,Integer.parseInt(s_y[i])));			
		}
		for(int i=0;i<number;i++)
		{	
			stone.add(new Stone(Integer.parseInt(s_stone_x[i])-ViewAnt.generateRandom(5),Integer.parseInt(s_stone_y[i])/*-ViewAnt.generateRandom(3)*/));		
		}
		AntNum=0;
	}
}
